package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.GreMapStatDao;
import cn.topevery.garden.entity.oneMap.CountVO;
import cn.topevery.garden.entity.po.GreMapStat;
import cn.topevery.garden.entity.query.GreMapStatQuery;
import cn.topevery.garden.entity.vo.GreMapStatVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 
 *
 * @author code-generate
 * @date 2022-01-05
 */
@Service
public class GreMapStatLogic extends BaseLogic<GreMapStat> {
    @Autowired
    GreMapStatDao greMapStatDao;

    @Override
    public BaseEntityDao<GreMapStat, Integer> getDao() {
        return greMapStatDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<GreMapStatVO> listPage(GreMapStatQuery query) {
        return greMapStatDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        greMapStatDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param greMapStat 实体
     */
    public void saveOrUpdate(String userId, GreMapStat greMapStat){
        greMapStatDao.saveOrUpdate(userId,greMapStat);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public GreMapStat getEntityByColumn(String key, String value) {
        return greMapStatDao.getEntityByColumn(key, value);
    }

    public void updateSql(GreMapStat greMapStat) {
        greMapStatDao.updateSql(greMapStat);
    }
    public void insertSql(GreMapStat greMapStat) {
        greMapStatDao.insertSql(greMapStat);
    }
    public List<CountVO> getYears() {
        return greMapStatDao.getYears();
    }
    public List<Map<String, Object>> getAreaInfo(Integer year) {
        return greMapStatDao.getAreaInfo(year);
    }
    public List<GreMapStat> search(Map<String, Object> map) {
        return greMapStatDao.search(map);
    }
}
